requireJS(['constant', 'site', 'handlebars'], function (Constant, site, Handlebars) {
    var url = {
        resetAdminPassword: "manager/resetAdminPassword.do"
    }

    $("#changePsw").on('click', function () {
        var psw = $("#psw").val();
        var repsw = $("#repsw").val();
        if (!psw) {
            Constant.fn.Message("I", "请输入密码");
            return;
        }
        if (!repsw) {
            Constant.fn.Message("I", "请再次输入密码");
            return;
        }
        if (psw != repsw) {
            Constant.fn.Message("I", "请输入两次相同的密码");
            return;
        }
        site.send({
            url: url.resetAdminPassword,
            data: {
                id: JSON.parse(localStorage.getItem('content')).admin.id,
                password: psw,
                againPassword: repsw,
                systemcode: JSON.parse(localStorage.getItem('content')).admin.systemcode
            },
            callback: function (data) {
                data = JSON.parse(data)
                if (data.type == '1') {
                    Constant.fn.Message('T', data.msg);
                }
                else {
                    Constant.fn.Message('F', data.msg);
                }
            }
        })
    })
})